package com.beibei.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.beibei.common.R;
import com.beibei.entity.BasicsWordBook;
import com.beibei.service.BasicsWordBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/beisong")
public class BasicsWordBookController {
    @Autowired
    private BasicsWordBookService basicsWordBookService;

    /**
     *单词查询
     * @return
     */
    @GetMapping("/learn")
    public R<List<BasicsWordBook>> select() {
        // 条件构造器
        LambdaQueryWrapper<BasicsWordBook> queryWrapper = new LambdaQueryWrapper<>();
        // 添加条件
        queryWrapper.between(BasicsWordBook::getWid,20,30);
        List<BasicsWordBook> list = basicsWordBookService.list(queryWrapper);
        return R.success(list);
    }
}
